﻿<UserControl xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"  xmlns:ctrls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
  xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
  xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:ltoolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
  xmlns:bureauBlack="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.BureauBlack"  
  xmlns:regions="clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation"
  xmlns:cmd="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation"             
  xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"  
  xmlns:help="clr-namespace:TelecoSystems.Infrastructure.Helpers;assembly=TelecoSystems.Infrastructure"
  x:Class="TelecoSystems.Views.ShellView"             
  mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600" x:Name="ShellUserControl">
    <UserControl.Resources>
        <help:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
    </UserControl.Resources>
    <bureauBlack:BureauBlackTheme Background="#FF333333" FontSize="11">
        <controlsToolkit:BusyIndicator x:Name="BusyIndicator" BusyContent="{Binding BusyContent}" IsBusy="{Binding IsBusy}" Foreground="Black" DisplayAfter="0:0:0.0" FontSize="11" OverlayStyle="{StaticResource ActivityOverlayStyle}" RenderTransformOrigin="0.5,0.5">
            <!--<controlsToolkit:BusyIndicator.RenderTransform>
                <CompositeTransform/>
            </controlsToolkit:BusyIndicator.RenderTransform>
            <controlsToolkit:BusyIndicator.Projection>
                <PlaneProjection/>
            </controlsToolkit:BusyIndicator.Projection>-->
            <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}" Margin="0">
                <Grid.Background>
                    <ImageBrush Opacity="0.25" ImageSource="../../Assets/Images/login-background.jpg" />
                </Grid.Background>
                <Grid x:Name="BackgroundGrid" Margin="50,0,0,50" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5" d:LayoutOverrides="Width" HorizontalAlignment="Left">
                    <TextBlock TextWrapping="Wrap" Text="Teleco Systems" FontSize="96" FontFamily="Segoe UI Semibold" Foreground="#0CFFFFFF" VerticalAlignment="Center" Margin="0,100,0,0"/>
                    <Image x:Name="LogoBG" Source="/TelecoSystems;component/Assets/Images/logo.png" Stretch="Fill" Width="64" HorizontalAlignment="Left" Margin="-5,0,0,50" Height="64" RenderTransformOrigin="0.477,0.539" Opacity="0.05" VerticalAlignment="Center"/>
                </Grid>
                <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}" Margin="0,73,0,0">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,0.0450000017881393" StartPoint="0.5,0">
                            <GradientStop Color="#3DCCCCCC"/>
                            <GradientStop Color="#00CCCCCC" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <!--<navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}" 
                              Source="/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
                <navigation:Frame.UriMapper>
                  <uriMapper:UriMapper>
                    <uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
                    <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                  </uriMapper:UriMapper>
                </navigation:Frame.UriMapper>
            </navigation:Frame>-->
                    <ltoolkit:TransitioningContentControl x:Name="MainRegion"
						regions:RegionManager.RegionName="MainRegion" RestartTransitionOnContentChange="True" Transition="UpTransition" Style="{StaticResource TransitioningContentControlStyle}" />
                    <!--<ContentControl x:Name="MainRegion"
                      regions:RegionManager.RegionName="MainRegion"/>-->
                </Border>

                <Grid x:Name="TopPanel" Style="{StaticResource NavigationOuterGridStyle}">
                    <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}" Height="74">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                                <GradientStop Color="#FF445B80" Offset="0.371"/>
                                <GradientStop Color="#FF0F1D33" Offset="1"/>
                                <GradientStop Color="#FF233C64"/>
                                <GradientStop Color="#FE19386A" Offset="0.991"/>
                            </LinearGradientBrush>
                        </Grid.Background>

                        <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}" Margin="0,8,0,0">
                            <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}" Margin="90,0,0,0">

                                <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" 
                            		Text="{Binding ApplicationStrings.ApplicationName, Source={StaticResource ResourceWrapper}}"/>

                            </StackPanel>
                        </Border>

                        <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}" Margin="15,0">
                            <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}" Orientation="Horizontal" VerticalAlignment="Top" Margin="0,9,0,0">

                                <ItemsControl ItemsSource="{Binding Modules}">
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal"/>
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="{Binding Path=ModuleName, StringFormat=/TelecoSystems.Infrastructure;component/Assets/Icons/\{0\}.png}" Width="32" Height="32" Margin="4,0,-40,0" ToolTipService.ToolTip="{Binding ModuleName}" />
                                                <HyperlinkButton Style="{StaticResource LinkStyle}" 
												    cmd:Click.Command="{Binding DataContext.ActivateModuleCommand, ElementName=ShellUserControl}" cmd:Click.CommandParameter="{Binding ModuleName}" Content="{Binding ModuleName}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>

                                <Button x:Name="InstallButton" cmd:Click.Command="{Binding InstallCommand}" Visibility="{Binding IsNotInstalled, Converter={StaticResource BoolToVisibilityConverter}}" Cursor="Hand">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Source="/TelecoSystems;component/Assets/Images/install.png" ToolTipService.ToolTip="Install the application to your computer" Margin="20,0,0,0" Height="32">
                                            </Image>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>

                                <Button x:Name="ProfileButton" cmd:Click.Command="{Binding ShowProfileCommand}" Cursor="Hand">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Source="/TelecoSystems;component/Assets/Images/profile.png" ToolTipService.ToolTip="Show your profile" Margin="20,0,0,0" Height="32">
                                            </Image>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>

                                <!--<HyperlinkButton x:Name="Link1" Style="{StaticResource LinkStyle}" 
                                  cmd:Click.Command="{Binding ActivateModuleCommand}" cmd:Click.CommandParameter="Products" Content="{Binding ApplicationStrings.HomePageTitle, Source={StaticResource ResourceWrapper}}"/>

                            <Rectangle x:Name="Divider1" Style="{StaticResource DividerStyle}"/>

                            <HyperlinkButton x:Name="Link2" Style="{StaticResource LinkStyle}" 
                                    Click="Link2_Click" TargetName="ContentFrame" Content="{Binding ApplicationStrings.AboutPageTitle, Source={StaticResource ResourceWrapper}}"/>-->

                            </StackPanel>
                        </Border>

                    </Grid>
                    <Border Margin="0,54,0,0" Style="{StaticResource MetaContainerStyle}">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <StackPanel x:Name="StatusBar" Margin="0,1,20,0" Orientation="Horizontal">
                                <TextBlock Text="{Binding ModeStatus}" Foreground="WhiteSmoke" />
                                <TextBlock Text="{Binding OnlineStatus}" Margin="20,0,0,0" Foreground="WhiteSmoke" />
                            </StackPanel>
                            <Border x:Name="loginContainer">
                                <!-- LoginStatus will be added here in code behind. This is required for the designer view to work -->
                            </Border>
                        </StackPanel>
                    </Border>
                    <Image x:Name="Logo" Source="/TelecoSystems.Infrastructure;component/Assets/Images/logo.png" Stretch="Fill" Width="64" Height="64" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" Margin="12,5,0,0"/>
                </Grid>
            </Grid>
        </controlsToolkit:BusyIndicator>
    </bureauBlack:BureauBlackTheme>
</UserControl>